package com.mashang.bookkeepingbook.service.impl;

import com.mashang.bookkeepingbook.mapper.CategoryMapper;
import com.mashang.bookkeepingbook.pojo.entity.Categories;
import com.mashang.bookkeepingbook.pojo.entity.Category;
import com.mashang.bookkeepingbook.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    public Category selectByType() {
        //查询支出的类别
        List<Categories> ecategories = categoryMapper.selectECategory();
        //查询入账的类别
        List<Categories> icategories = categoryMapper.selectICategory();
        //查询不计入收支的类别
        List<Categories> ncategories = categoryMapper.selectNCategory();
        return new Category(ecategories,icategories,ncategories);
    }
}
